<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Accelerator Maps</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="GTK+ 3 参考手册">
<link rel="up" href="gtkbase.html" title="Part II. GTK+核心参考">
<link rel="prev" href="gtk3-Keyboard-Accelerators.html" title="Accelerator Groups">
<link rel="next" href="gtk3-Clipboards.html" title="Clipboards">
<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="gtk3-Keyboard-Accelerators.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="gtkbase.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GTK+ 3 参考手册</th>
<td><a accesskey="n" href="gtk3-Clipboards.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#gtk3-Accelerator-Maps.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#gtk3-Accelerator-Maps.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry">
<a name="gtk3-Accelerator-Maps"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="gtk3-Accelerator-Maps.top_of_page"></a>Accelerator Maps</span></h2>
<p>Accelerator Maps — Loadable keyboard accelerator specifications</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="gtk3-Accelerator-Maps.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include &lt;gtk/gtk.h&gt;

                    <a class="link" href="gtk3-Accelerator-Maps.html#GtkAccelMap" title="GtkAccelMap">GtkAccelMap</a>;
<span class="returnvalue">void</span>                (<a class="link" href="gtk3-Accelerator-Maps.html#GtkAccelMapForeach" title="GtkAccelMapForeach ()">*GtkAccelMapForeach</a>)               (<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *accel_path</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> accel_key</code></em>,
                                                         <em class="parameter"><code><a href="../gdk3/gdk3-Windows.html#GdkModifierType"><span class="type">GdkModifierType</span></a> accel_mods</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> changed</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-Accelerator-Maps.html#gtk-accel-map-add-entry" title="gtk_accel_map_add_entry ()">gtk_accel_map_add_entry</a>             (<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *accel_path</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> accel_key</code></em>,
                                                         <em class="parameter"><code><a href="../gdk3/gdk3-Windows.html#GdkModifierType"><span class="type">GdkModifierType</span></a> accel_mods</code></em>);
<a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="gtk3-Accelerator-Maps.html#gtk-accel-map-lookup-entry" title="gtk_accel_map_lookup_entry ()">gtk_accel_map_lookup_entry</a>          (<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *accel_path</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-Keyboard-Accelerators.html#GtkAccelKey" title="struct GtkAccelKey"><span class="type">GtkAccelKey</span></a> *key</code></em>);
<a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="gtk3-Accelerator-Maps.html#gtk-accel-map-change-entry" title="gtk_accel_map_change_entry ()">gtk_accel_map_change_entry</a>          (<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *accel_path</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> accel_key</code></em>,
                                                         <em class="parameter"><code><a href="../gdk3/gdk3-Windows.html#GdkModifierType"><span class="type">GdkModifierType</span></a> accel_mods</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> replace</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-Accelerator-Maps.html#gtk-accel-map-load" title="gtk_accel_map_load ()">gtk_accel_map_load</a>                  (<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *file_name</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-Accelerator-Maps.html#gtk-accel-map-save" title="gtk_accel_map_save ()">gtk_accel_map_save</a>                  (<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *file_name</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-Accelerator-Maps.html#gtk-accel-map-foreach" title="gtk_accel_map_foreach ()">gtk_accel_map_foreach</a>               (<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-Accelerator-Maps.html#GtkAccelMapForeach" title="GtkAccelMapForeach ()"><span class="type">GtkAccelMapForeach</span></a> foreach_func</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-Accelerator-Maps.html#gtk-accel-map-load-fd" title="gtk_accel_map_load_fd ()">gtk_accel_map_load_fd</a>               (<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> fd</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-Accelerator-Maps.html#gtk-accel-map-save-fd" title="gtk_accel_map_save_fd ()">gtk_accel_map_save_fd</a>               (<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> fd</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-Accelerator-Maps.html#gtk-accel-map-load-scanner" title="gtk_accel_map_load_scanner ()">gtk_accel_map_load_scanner</a>          (<em class="parameter"><code><a href="../glib/glib-Lexical-Scanner.html#GScanner"><span class="type">GScanner</span></a> *scanner</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-Accelerator-Maps.html#gtk-accel-map-add-filter" title="gtk_accel_map_add_filter ()">gtk_accel_map_add_filter</a>            (<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *filter_pattern</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-Accelerator-Maps.html#gtk-accel-map-foreach-unfiltered" title="gtk_accel_map_foreach_unfiltered ()">gtk_accel_map_foreach_unfiltered</a>    (<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-Accelerator-Maps.html#GtkAccelMapForeach" title="GtkAccelMapForeach ()"><span class="type">GtkAccelMapForeach</span></a> foreach_func</code></em>);
<a class="link" href="gtk3-Accelerator-Maps.html#GtkAccelMap" title="GtkAccelMap"><span class="returnvalue">GtkAccelMap</span></a> *       <a class="link" href="gtk3-Accelerator-Maps.html#gtk-accel-map-get" title="gtk_accel_map_get ()">gtk_accel_map_get</a>                   (<em class="parameter"><code><span class="type">void</span></code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-Accelerator-Maps.html#gtk-accel-map-lock-path" title="gtk_accel_map_lock_path ()">gtk_accel_map_lock_path</a>             (<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *accel_path</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-Accelerator-Maps.html#gtk-accel-map-unlock-path" title="gtk_accel_map_unlock_path ()">gtk_accel_map_unlock_path</a>           (<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *accel_path</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="gtk3-Accelerator-Maps.description"></a><h2>Description</h2>
<p>
Accelerator maps are used to define runtime configurable accelerators.
Functions for manipulating them are are usually used by higher level
convenience mechanisms like <a class="link" href="gtk3-GtkUIManager.html#GtkUIManager" title="struct GtkUIManager"><span class="type">GtkUIManager</span></a> and are thus considered
"low-level". You'll want to use them if you're manually creating menus that
should have user-configurable accelerators.
</p>
<p>
Accelerator is uniquely defined by:
</p>
<p>
</p>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem"><p>accelerator path</p></li>
<li class="listitem"><p>accelerator key</p></li>
<li class="listitem"><p>accelerator modifiers</p></li>
</ul></div>
<p>
</p>
<p>
The accelerator path must consist of
"&lt;WINDOWTYPE&gt;/Category1/Category2/.../Action", where WINDOWTYPE
should be a unique application-specific identifier that corresponds to the
kind of window the accelerator is being used in, e.g. "Gimp-Image",
"Abiword-Document" or "Gnumeric-Settings".
The "Category1/.../Action" portion is most appropriately chosen by the action
the accelerator triggers, i.e. for accelerators on menu items, choose the
item's menu path, e.g. "File/Save As", "Image/View/Zoom" or
"Edit/Select All". So a full valid accelerator path may look like:
"&lt;Gimp-Toolbox&gt;/File/Dialogs/Tool Options...".
</p>
<p>
All accelerators are stored inside one global <a class="link" href="gtk3-Accelerator-Maps.html#GtkAccelMap" title="GtkAccelMap"><span class="type">GtkAccelMap</span></a> that can be
obtained using <a class="link" href="gtk3-Accelerator-Maps.html#gtk-accel-map-get" title="gtk_accel_map_get ()"><code class="function">gtk_accel_map_get()</code></a>. See <a class="link" href="gtk3-Accelerator-Maps.html#monitoring-changes" title="Monitoring changes">Monitoring changes</a> for additional
details.
</p>
<p>
</p>
<div class="refsect2">
<a name="manipulating-accelerators"></a><h3>Manipulating accelerators</h3>
<p>
New accelerators can be added using <a class="link" href="gtk3-Accelerator-Maps.html#gtk-accel-map-add-entry" title="gtk_accel_map_add_entry ()"><code class="function">gtk_accel_map_add_entry()</code></a>. To search for
specific accelerator, use <a class="link" href="gtk3-Accelerator-Maps.html#gtk-accel-map-lookup-entry" title="gtk_accel_map_lookup_entry ()"><code class="function">gtk_accel_map_lookup_entry()</code></a>. Modifications of
existing accelerators should be done using <a class="link" href="gtk3-Accelerator-Maps.html#gtk-accel-map-change-entry" title="gtk_accel_map_change_entry ()"><code class="function">gtk_accel_map_change_entry()</code></a>.
</p>
<p>
In order to avoid having some accelerators changed, they can be locked using
<a class="link" href="gtk3-Accelerator-Maps.html#gtk-accel-map-lock-path" title="gtk_accel_map_lock_path ()"><code class="function">gtk_accel_map_lock_path()</code></a>. Unlocking is done using
<a class="link" href="gtk3-Accelerator-Maps.html#gtk-accel-map-unlock-path" title="gtk_accel_map_unlock_path ()"><code class="function">gtk_accel_map_unlock_path()</code></a>.
</p>
</div>
<p>
</p>
<hr>
<div class="refsect2">
<a name="saving-and-loading"></a><h3>Saving and loading accelerator maps</h3>
<p>
Accelerator maps can be saved to and loaded from some external resource. For
simple saving and loading from file, <a class="link" href="gtk3-Accelerator-Maps.html#gtk-accel-map-save" title="gtk_accel_map_save ()"><code class="function">gtk_accel_map_save()</code></a> and
<a class="link" href="gtk3-Accelerator-Maps.html#gtk-accel-map-load" title="gtk_accel_map_load ()"><code class="function">gtk_accel_map_load()</code></a> are provided. Saving and loading can also be done by
providing file descriptor to <a class="link" href="gtk3-Accelerator-Maps.html#gtk-accel-map-save-fd" title="gtk_accel_map_save_fd ()"><code class="function">gtk_accel_map_save_fd()</code></a> and
<a class="link" href="gtk3-Accelerator-Maps.html#gtk-accel-map-load-fd" title="gtk_accel_map_load_fd ()"><code class="function">gtk_accel_map_load_fd()</code></a>.
</p>
</div>
<p>
</p>
<hr>
<div class="refsect2">
<a name="monitoring-changes"></a><h3>Monitoring changes</h3>
<p>
<a class="link" href="gtk3-Accelerator-Maps.html#GtkAccelMap" title="GtkAccelMap"><span class="type">GtkAccelMap</span></a> object is only useful for monitoring changes of accelerators. By
connecting to <span class="type">"changed"</span> signal, one can monitor changes of all
accelerators. It is also possible to monitor only single accelerator path by
using it as a detail of the <span class="type">"changed"</span> signal.
</p>
</div>
<p>
</p>
</div>
<div class="refsect1">
<a name="gtk3-Accelerator-Maps.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="GtkAccelMap"></a><h3>GtkAccelMap</h3>
<pre class="programlisting">typedef struct _GtkAccelMap GtkAccelMap;</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2">
<a name="GtkAccelMapForeach"></a><h3>GtkAccelMapForeach ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                (*GtkAccelMapForeach)               (<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *accel_path</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> accel_key</code></em>,
                                                         <em class="parameter"><code><a href="../gdk3/gdk3-Windows.html#GdkModifierType"><span class="type">GdkModifierType</span></a> accel_mods</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> changed</code></em>);</pre>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>User data passed to <a class="link" href="gtk3-Accelerator-Maps.html#gtk-accel-map-foreach" title="gtk_accel_map_foreach ()"><code class="function">gtk_accel_map_foreach()</code></a> or
<a class="link" href="gtk3-Accelerator-Maps.html#gtk-accel-map-foreach-unfiltered" title="gtk_accel_map_foreach_unfiltered ()"><code class="function">gtk_accel_map_foreach_unfiltered()</code></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>accel_path</code></em> :</span></p></td>
<td>Accel path of the current accelerator</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>accel_key</code></em> :</span></p></td>
<td>Key of the current accelerator</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>accel_mods</code></em> :</span></p></td>
<td>Modifiers of the current accelerator</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>changed</code></em> :</span></p></td>
<td>Changed flag of the accelerator (if <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>, accelerator has changed
during runtime and would need to be saved during an accelerator dump)</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-accel-map-add-entry"></a><h3>gtk_accel_map_add_entry ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_accel_map_add_entry             (<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *accel_path</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> accel_key</code></em>,
                                                         <em class="parameter"><code><a href="../gdk3/gdk3-Windows.html#GdkModifierType"><span class="type">GdkModifierType</span></a> accel_mods</code></em>);</pre>
<p>
Registers a new accelerator with the global accelerator map.
This function should only be called once per <em class="parameter"><code>accel_path</code></em>
with the canonical <em class="parameter"><code>accel_key</code></em> and <em class="parameter"><code>accel_mods</code></em> for this path.
To change the accelerator during runtime programatically, use
<a class="link" href="gtk3-Accelerator-Maps.html#gtk-accel-map-change-entry" title="gtk_accel_map_change_entry ()"><code class="function">gtk_accel_map_change_entry()</code></a>.
</p>
<p>
Note that <em class="parameter"><code>accel_path</code></em> string will be stored in a <a href="../glib/glib-Quarks.html#GQuark"><span class="type">GQuark</span></a>. Therefore, if you
pass a static string, you can save some memory by interning it first with 
<a href="../glib/glib-Quarks.html#g-intern-static-string"><code class="function">g_intern_static_string()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>accel_path</code></em> :</span></p></td>
<td>valid accelerator path</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>accel_key</code></em> :</span></p></td>
<td>the accelerator key</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>accel_mods</code></em> :</span></p></td>
<td>the accelerator modifiers</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-accel-map-lookup-entry"></a><h3>gtk_accel_map_lookup_entry ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            gtk_accel_map_lookup_entry          (<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *accel_path</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-Keyboard-Accelerators.html#GtkAccelKey" title="struct GtkAccelKey"><span class="type">GtkAccelKey</span></a> *key</code></em>);</pre>
<p>
Looks up the accelerator entry for <em class="parameter"><code>accel_path</code></em> and fills in <em class="parameter"><code>key</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>accel_path</code></em> :</span></p></td>
<td>a valid accelerator path</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>key</code></em> :</span></p></td>
<td>the accelerator key to be filled in (optional). <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>][<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <em class="parameter"><code>accel_path</code></em> is known, <a href="../glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-accel-map-change-entry"></a><h3>gtk_accel_map_change_entry ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            gtk_accel_map_change_entry          (<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *accel_path</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> accel_key</code></em>,
                                                         <em class="parameter"><code><a href="../gdk3/gdk3-Windows.html#GdkModifierType"><span class="type">GdkModifierType</span></a> accel_mods</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> replace</code></em>);</pre>
<p>
Changes the <em class="parameter"><code>accel_key</code></em> and <em class="parameter"><code>accel_mods</code></em> currently associated with <em class="parameter"><code>accel_path</code></em>.
Due to conflicts with other accelerators, a change may not always be possible,
<em class="parameter"><code>replace</code></em> indicates whether other accelerators may be deleted to resolve such
conflicts. A change will only occur if all conflicts could be resolved (which
might not be the case if conflicting accelerators are locked). Successful
changes are indicated by a <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> return value.
</p>
<p>
Note that <em class="parameter"><code>accel_path</code></em> string will be stored in a <a href="../glib/glib-Quarks.html#GQuark"><span class="type">GQuark</span></a>. Therefore, if you
pass a static string, you can save some memory by interning it first with 
<a href="../glib/glib-Quarks.html#g-intern-static-string"><code class="function">g_intern_static_string()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>accel_path</code></em> :</span></p></td>
<td>a valid accelerator path</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>accel_key</code></em> :</span></p></td>
<td>the new accelerator key</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>accel_mods</code></em> :</span></p></td>
<td>the new accelerator modifiers</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>replace</code></em> :</span></p></td>
<td>
<a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if other accelerators may be deleted upon conflicts</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the accelerator could be changed, <a href="../glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-accel-map-load"></a><h3>gtk_accel_map_load ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_accel_map_load                  (<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *file_name</code></em>);</pre>
<p>
Parses a file previously saved with <a class="link" href="gtk3-Accelerator-Maps.html#gtk-accel-map-save" title="gtk_accel_map_save ()"><code class="function">gtk_accel_map_save()</code></a> for
accelerator specifications, and propagates them accordingly.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>file_name</code></em> :</span></p></td>
<td>a file containing accelerator specifications,
in the GLib file name encoding. <span class="annotation">[<acronym title="Override the parsed C type with given type"><span class="acronym">type</span></acronym> filename]</span>
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-accel-map-save"></a><h3>gtk_accel_map_save ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_accel_map_save                  (<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *file_name</code></em>);</pre>
<p>
Saves current accelerator specifications (accelerator path, key
and modifiers) to <em class="parameter"><code>file_name</code></em>.
The file is written in a format suitable to be read back in by
<a class="link" href="gtk3-Accelerator-Maps.html#gtk-accel-map-load" title="gtk_accel_map_load ()"><code class="function">gtk_accel_map_load()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>file_name</code></em> :</span></p></td>
<td>the name of the file to contain
accelerator specifications, in the GLib file name encoding. <span class="annotation">[<acronym title="Override the parsed C type with given type"><span class="acronym">type</span></acronym> filename]</span>
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-accel-map-foreach"></a><h3>gtk_accel_map_foreach ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_accel_map_foreach               (<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-Accelerator-Maps.html#GtkAccelMapForeach" title="GtkAccelMapForeach ()"><span class="type">GtkAccelMapForeach</span></a> foreach_func</code></em>);</pre>
<p>
Loops over the entries in the accelerator map whose accel path 
doesn't match any of the filters added with <a class="link" href="gtk3-Accelerator-Maps.html#gtk-accel-map-add-filter" title="gtk_accel_map_add_filter ()"><code class="function">gtk_accel_map_add_filter()</code></a>, 
and execute <em class="parameter"><code>foreach_func</code></em> on each. The signature of <em class="parameter"><code>foreach_func</code></em> is 
that of <a class="link" href="gtk3-Accelerator-Maps.html#GtkAccelMapForeach" title="GtkAccelMapForeach ()"><span class="type">GtkAccelMapForeach</span></a>, the <em class="parameter"><code>changed</code></em> parameter indicates whether
this accelerator was changed during runtime (thus, would need
saving during an accelerator map dump).
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>data to be passed into <em class="parameter"><code>foreach_func</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>foreach_func</code></em> :</span></p></td>
<td>function to be executed for each accel
map entry which is not filtered out. <span class="annotation">[<acronym title="The callback is valid only during the call to the method."><span class="acronym">scope call</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-accel-map-load-fd"></a><h3>gtk_accel_map_load_fd ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_accel_map_load_fd               (<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> fd</code></em>);</pre>
<p>
Filedescriptor variant of <a class="link" href="gtk3-Accelerator-Maps.html#gtk-accel-map-load" title="gtk_accel_map_load ()"><code class="function">gtk_accel_map_load()</code></a>.
</p>
<p>
Note that the file descriptor will not be closed by this function.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>fd</code></em> :</span></p></td>
<td>a valid readable file descriptor</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-accel-map-save-fd"></a><h3>gtk_accel_map_save_fd ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_accel_map_save_fd               (<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> fd</code></em>);</pre>
<p>
Filedescriptor variant of <a class="link" href="gtk3-Accelerator-Maps.html#gtk-accel-map-save" title="gtk_accel_map_save ()"><code class="function">gtk_accel_map_save()</code></a>.
</p>
<p>
Note that the file descriptor will not be closed by this function.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>fd</code></em> :</span></p></td>
<td>a valid writable file descriptor</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-accel-map-load-scanner"></a><h3>gtk_accel_map_load_scanner ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_accel_map_load_scanner          (<em class="parameter"><code><a href="../glib/glib-Lexical-Scanner.html#GScanner"><span class="type">GScanner</span></a> *scanner</code></em>);</pre>
<p>
<a href="../glib/glib-Lexical-Scanner.html#GScanner"><span class="type">GScanner</span></a> variant of <a class="link" href="gtk3-Accelerator-Maps.html#gtk-accel-map-load" title="gtk_accel_map_load ()"><code class="function">gtk_accel_map_load()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>scanner</code></em> :</span></p></td>
<td>a <a href="../glib/glib-Lexical-Scanner.html#GScanner"><span class="type">GScanner</span></a> which has already been provided with an input file</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-accel-map-add-filter"></a><h3>gtk_accel_map_add_filter ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_accel_map_add_filter            (<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *filter_pattern</code></em>);</pre>
<p>
Adds a filter to the global list of accel path filters.
</p>
<p>
Accel map entries whose accel path matches one of the filters
are skipped by <a class="link" href="gtk3-Accelerator-Maps.html#gtk-accel-map-foreach" title="gtk_accel_map_foreach ()"><code class="function">gtk_accel_map_foreach()</code></a>.
</p>
<p>
This function is intended for GTK+ modules that create their own
menus, but don't want them to be saved into the applications accelerator
map dump.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>filter_pattern</code></em> :</span></p></td>
<td>a pattern (see <a href="../glib/glib-Glob-style-pattern-matching.html#GPatternSpec"><span class="type">GPatternSpec</span></a>)</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-accel-map-foreach-unfiltered"></a><h3>gtk_accel_map_foreach_unfiltered ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_accel_map_foreach_unfiltered    (<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-Accelerator-Maps.html#GtkAccelMapForeach" title="GtkAccelMapForeach ()"><span class="type">GtkAccelMapForeach</span></a> foreach_func</code></em>);</pre>
<p>
Loops over all entries in the accelerator map, and execute
<em class="parameter"><code>foreach_func</code></em> on each. The signature of <em class="parameter"><code>foreach_func</code></em> is that of
<a class="link" href="gtk3-Accelerator-Maps.html#GtkAccelMapForeach" title="GtkAccelMapForeach ()"><span class="type">GtkAccelMapForeach</span></a>, the <em class="parameter"><code>changed</code></em> parameter indicates whether
this accelerator was changed during runtime (thus, would need
saving during an accelerator map dump).
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>data to be passed into <em class="parameter"><code>foreach_func</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>foreach_func</code></em> :</span></p></td>
<td>function to be executed for each accel
map entry. <span class="annotation">[<acronym title="The callback is valid only during the call to the method."><span class="acronym">scope call</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-accel-map-get"></a><h3>gtk_accel_map_get ()</h3>
<pre class="programlisting"><a class="link" href="gtk3-Accelerator-Maps.html#GtkAccelMap" title="GtkAccelMap"><span class="returnvalue">GtkAccelMap</span></a> *       gtk_accel_map_get                   (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
Gets the singleton global <a class="link" href="gtk3-Accelerator-Maps.html#GtkAccelMap" title="GtkAccelMap"><span class="type">GtkAccelMap</span></a> object. This object
is useful only for notification of changes to the accelerator
map via the ::changed signal; it isn't a parameter to the
other accelerator map functions.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the global <a class="link" href="gtk3-Accelerator-Maps.html#GtkAccelMap" title="GtkAccelMap"><span class="type">GtkAccelMap</span></a> object. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
</td>
</tr></tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-accel-map-lock-path"></a><h3>gtk_accel_map_lock_path ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_accel_map_lock_path             (<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *accel_path</code></em>);</pre>
<p>
Locks the given accelerator path. If the accelerator map doesn't yet contain
an entry for <em class="parameter"><code>accel_path</code></em>, a new one is created.
</p>
<p>
Locking an accelerator path prevents its accelerator from being changed 
during runtime. A locked accelerator path can be unlocked by 
<a class="link" href="gtk3-Accelerator-Maps.html#gtk-accel-map-unlock-path" title="gtk_accel_map_unlock_path ()"><code class="function">gtk_accel_map_unlock_path()</code></a>. Refer to <a class="link" href="gtk3-Accelerator-Maps.html#gtk-accel-map-change-entry" title="gtk_accel_map_change_entry ()"><code class="function">gtk_accel_map_change_entry()</code></a> 
for information about runtime accelerator changes.
</p>
<p>
If called more than once, <em class="parameter"><code>accel_path</code></em> remains locked until
<a class="link" href="gtk3-Accelerator-Maps.html#gtk-accel-map-unlock-path" title="gtk_accel_map_unlock_path ()"><code class="function">gtk_accel_map_unlock_path()</code></a> has been called an equivalent number
of times.
</p>
<p>
Note that locking of individual accelerator paths is independent from 
locking the <a class="link" href="gtk3-Keyboard-Accelerators.html#GtkAccelGroup" title="struct GtkAccelGroup"><span class="type">GtkAccelGroup</span></a> containing them. For runtime accelerator
changes to be possible both the accelerator path and its <a class="link" href="gtk3-Keyboard-Accelerators.html#GtkAccelGroup" title="struct GtkAccelGroup"><span class="type">GtkAccelGroup</span></a>
have to be unlocked.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>accel_path</code></em> :</span></p></td>
<td>a valid accelerator path</td>
</tr></tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-accel-map-unlock-path"></a><h3>gtk_accel_map_unlock_path ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_accel_map_unlock_path           (<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *accel_path</code></em>);</pre>
<p>
Undoes the last call to <a class="link" href="gtk3-Accelerator-Maps.html#gtk-accel-map-lock-path" title="gtk_accel_map_lock_path ()"><code class="function">gtk_accel_map_lock_path()</code></a> on this <em class="parameter"><code>accel_path</code></em>.
Refer to <a class="link" href="gtk3-Accelerator-Maps.html#gtk-accel-map-lock-path" title="gtk_accel_map_lock_path ()"><code class="function">gtk_accel_map_lock_path()</code></a> for information about accelerator path locking.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>accel_path</code></em> :</span></p></td>
<td>a valid accelerator path</td>
</tr></tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
</div>
<div class="refsect1">
<a name="gtk3-Accelerator-Maps.see-also"></a><h2>See Also</h2>
<a class="link" href="gtk3-Keyboard-Accelerators.html#GtkAccelGroup" title="struct GtkAccelGroup"><span class="type">GtkAccelGroup</span></a>, <a class="link" href="gtk3-Keyboard-Accelerators.html#GtkAccelKey" title="struct GtkAccelKey"><span class="type">GtkAccelKey</span></a>, <a class="link" href="gtk3-GtkUIManager.html#GtkUIManager" title="struct GtkUIManager"><span class="type">GtkUIManager</span></a>, <a class="link" href="gtk3-GtkWidget.html#gtk-widget-set-accel-path" title="gtk_widget_set_accel_path ()"><code class="function">gtk_widget_set_accel_path()</code></a>, <a class="link" href="gtk3-GtkMenuItem.html#gtk-menu-item-set-accel-path" title="gtk_menu_item_set_accel_path ()"><code class="function">gtk_menu_item_set_accel_path()</code></a>, <span class="type">"gtk-can-change-accels"</span>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.18</div>
</body>
</html>